package com.hspedu.extend_.exercise;

public class ExtendsExercise01 {
    public static void main(String[] args) {
        BB b = new BB();
    }
}

class AA{
    AA(){
        System.out.println("a");
    }
    AA(String name){
        System.out.println("a name");
    }
}

class BB extends AA{
    public BB() {
        this("abc");//this即调用本类的构造器，调用哪个呢，有一个字符串"abc",即调用有参构造器public B(String name)
        System.out.println("b");
    }

    public BB(String name) {
        super();
        System.out.println("b name");
    }
}